<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div class="app">
        <h1>{{ name }}</h1>

        <h1 :title="name">{{ name }}</h1>

        <h2 v-if="hasText">Show this text for if</h2>

        <h2 v-show="hasText">Show this text for show</h2>

        <ul>
            <li v-for="a in users">
                {{a}}
            </li>
        </ul>
    </div>
<script>

    // var users = [
    //     { name: 'WWW', age: 21 },
    //     { name: 'XXX', age: 30 },
    //     { name: 'ZZZ', age: 40 },
    //     { name: 'YYY', age: 50 },
    //     { name: 'HHH', age: 22 },
    //     { name: 'ddd', age: 25 },
    // ];
    //
    // for (var a in users){
    //     console.log(a);
    // }



    new Vue({
        el: '.app',
        data: {
            name: '王伟健',
            hasText: false,
            users: [
                { name: 'WWW', age: 21 },
                { name: 'XXX', age: 30 },
                { name: 'ZZZ', age: 40 },
                { name: 'YYY', age: 50 },
                { name: 'HHH', age: 22 },
                { name: 'ddd', age: 25 },
            ]
        }
    })
</script>

</body>
</html>